﻿using ExportExcelDemo.Core.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace ExportExcelDemo.Core
{
    public class TeacherManager
    {

        /// <summary>
        /// 插入老师数据
        /// </summary>
        /// <param name="model"></param>
        public void InsertTeacher(Teacher model)
        {

            try
            {
                var sql = @"insert into Teacher(Name,Age,SchoolNum) values(@Name,@Age,@SchoolNum)";
                SqlHelper.ExecuteNonquery(sql, System.Data.CommandType.Text, new System.Data.SqlClient.SqlParameter[] {
                new SqlParameter("@Name",model.Name),
                new SqlParameter("@Age",model.Age),
                new SqlParameter("@SchoolNum",model.SchoolNum)
            });
            }
            catch(Exception ex)
            {
                throw ex;
            }
          

        }

    }
}
